package com.mldong.timer;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.mldong.annotation.DictEnum;
import com.mldong.base.CodedEnum;

@DictEnum(key = "sys_timer_state", name = "定时任务状态")
public enum TimerStateEnum implements CodedEnum {
    RUNNING(1, "运行"),
    STOP(2, "停止"),
    ;
    private Integer code;
    private String message;

    @JsonCreator
    public static TimerStateEnum forValue(Object value) {
        return CodedEnum.codeOf(TimerStateEnum.class, value).get();
    }

    TimerStateEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    @JsonValue
    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
    ;

}
